package com.hp.controller;

import com.hp.entity.Member;
import com.hp.service.MemberService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hp
 */
@RestController
@RequestMapping("/member")
public class MemberController {

    @Resource
    private MemberService memberService;

    @PostMapping("/insert")
    public void insert() {
        memberService.insert();
    }


    @GetMapping("/listAll")
    public List<Member> listAll() {
        return memberService.listAll();
    }


    @GetMapping("/listByMemberId")
    public List<Member> listByMemberId(String memberId) {
        return memberService.listByMemberId(memberId);
    }


}
